package top.jnaw.jee.platform;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jfinal.kit.PropKit;
import top.jnaw.jee.utils.qiniu.PropertyUtil;

public class Consts {

  public static final boolean LOCAL_SERVER = false;

  public static final String PROJECT_NAME = PropKit.get("project_name", "");
  public static final String LINK = PropKit.get("link", "");

  public static final String NIM_KEY = PropKit.get("nim_app_key", "");
  public static final String NIM_SECRET = PropKit.get("nim_app_secret", "");

  public static final String NIM_SMS_KEY = PropKit.get("nim_sms_app_key", "");
  public static final String NIM_SMS_SECRET = PropKit
      .get("nim_sms_app_secret", "");

  public static final String JPUSH_MASTER_SECRET = PropKit
      .get("jpush_master_secret", "");
  public static final String JPUSH_APP_KEY = PropKit.get("jpush_app_key", "");

  public static final String WECHAT_APPID = PropKit.get("wechat_appid");
  public static final String WECHAT_SECRET = PropKit.get("wechat_secret");

  public static final String DOMAIN = PropKit.get("domain_url");

  public static final String WECHAT_REDIRECT_URL =
      PropKit.get("domain_url") + PropKit.get("project_name") + PropKit
          .get("wechat_redirect_url");
  public static final String ENCODE = "UTF-8";

  public static final String CACHE_NAME = PropKit.get("cache_name", "");

  //  QiNiu
  public static final String bucketName = PropertyUtil
      .getProperty("bucketName");
  public static final String domain = PropertyUtil.getProperty("domain");
  public static final String ACCESS_KEY = PropertyUtil
      .getProperty("ACCESS_KEY");
  public static final String SECRET_KEY = PropertyUtil
      .getProperty("SECRET_KEY");

  public static final int DEFAULT_DEPARTMENT_TYPE = 1;
  public static final int DEFAULT_BAD_ID = 0;
  public static final int DEFAULT_BAD_ID_1 = 1;
  public static final double DEFAULT_DOUBLE = 0.0f;
  public static final float DEFAULT_FLOAT = 0.0f;
  public static final int DEFAULT_PAGE = 1;
  public static final int DEFAULT_PAGE_SIZE = PropKit
      .getInt("paginate_size", 10);

  public static final String JSON_RES_RESULT = "result";
  public static final String JSON_RES_DATA = "data";
  public static final String JSON_RES_PAGE = "page";
  public static final String JSON_RES_SIZE = "size";
  public static final String JSON_RES_ROWS = "rows";
  public static final String JSON_RES_TOTAL = "total";
  public static final String JSON_RES_APPROVERS = "approvers";
  public static final String JSON_RES_MINI_PASS = "minimum_pass";
  public static final String JSON_RES_LAST_MODIFY = "last_modify_time";

  public static final String FROM_APP = "app";
  public static final String FROM_WECHAT = "wechat";
  public static final String FROM_WEB = "web";

  public static final String MODE_SINGLE = "single";

  public static final String PLATFORM_ANDROID = "android";
  public static final String PLATFORM_IOS = "ios";

  public static final String WECHAT_CODE = "errcode";
  public static final String WECHAT_MSG = "errmsg";

  public static final String ACCESS_TOKEN = "access_token";
  public static final String TICKET = "ticket";
  public static final String OPENID = "openid";

  public static final String APPROVAL_LAND_FIRST_DNAME = "所在街道";
  public static final String APPROVAL_LAND_SECOND_DNAME = "区产权交易中心";
  public static final String APPROVAL_LOAN_DNAME = "区产权交易中心";
  public static final String APPROVAL_MEDIATION_FIRST_DNAME = "区产权交易中心";
  public static final String APPROVAL_MEDIATION_SECOND_DNAME = "所在街道";

  public static final String APPROVAL_CHECKED = "checked";
  public static final String APPROVAL_CHECKING = "checking";
  public static final String APPROVAL_PASSED = "passed";
  public static final String APPROVAL_REJECTED = "rejected";
  public static final String APPROVAL_CANCEL = "cancel";
  public static final String APPROVAL_SUCCESS = "success";
  public static final String APPROVAL_FAIL = "fail";
  public static final Integer[] EMPTY_INTEGER_ARRAY = new Integer[]{};

  public static final String FEEDBACK_ID = PropKit
      .get("feedback_id");

  public static final String APPROVAL_STAGE = PropKit
      .get("approval_stage");

    public static final String HOLD_COURT = PropKit
      .get("hold_court");

  public static final String UPLOAD_FOLDER = LOCAL_SERVER ? PropKit
      .get("upload_local_folder") : PropKit.get("upload_folder");
  public static final String UPLOAD_APP = LOCAL_SERVER ? PropKit
      .get("upload_local_app") : PropKit.get("upload_app");
  public static final String UPLOAD_QINIU = LOCAL_SERVER ? PropKit
      .get("upload_local_QiNiu") : PropKit.get("upload_QiNiu");
  public static final String UPLOAD_URL_BASE = PropKit.get("upload_url_base");
  public static final String UPLOAD_URL_IMG = PropKit.get("upload_url_img");

  public static final String PATTERN_DATE = "yyyy-MM-dd";
  public static final String PATTERN_MOUTH = "yyyy-MM";
  public static final String PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss";
  public static final String PATTERN_DATETIME_HH_MM = "yyyy-MM-dd HH:mm";

  public static final JSONObject EMPTY_OBJECT = new JSONObject();
  public static final JSONArray EMPTY_ARRAY = new JSONArray();
  public static final String TYPE_CONTACT = "contact";
  public static final String TYPE_SIGN = "sign";
  //通知模板
  public static final String NIM_NOTIFY_TEMPLATE_APPROVE = PropKit
      .get("NIM_NOTIFY_TEMPLATE_APPROVE");
  public static final String NIM_NOTIFY_TEMPLATE_REPLY = PropKit
      .get("NIM_NOTIFY_TEMPLATE_REPLY");
  public static final String NIM_NOTIFY_TEMPLATE_CHARGED = PropKit
      .get("NIM_NOTIFY_TEMPLATE_CHARGED");
  public static final String NIM_NOTIFY_TEMPLATE_COLLECTION = PropKit
      .get("NIM_NOTIFY_TEMPLATE_COLLECTION");
  public static final String NIM_NOTIFY_TEMPLATE_REMIND = PropKit
      .get("NIM_NOTIFY_TEMPLATE_REMIND");
  public static final String NIM_NOTIFY_TEMPLATE_DELAY = PropKit
      .get("NIM_NOTIFY_TEMPLATE_DELAY");
  public static final String NIM_NOTIFY_TEMPLATE_REGISTER = PropKit
      .get("NIM_NOTIFY_TEMPLATE_REGISTER");
  public static final String NIM_NOTIFY_TEMPLATE_EMAILRECEIVE = PropKit
      .get("NIM_NOTIFY_TEMPLATE_EMAILRECEIVE");
  public static final String NIM_NOTIFY_TEMPLATE_EMAILSECRET = PropKit
      .get("NIM_NOTIFY_TEMPLATE_EMAILSECRET");
  public static final String NIM_NOTIFY_TEMPLATE_UNREAD = PropKit
      .get("NIM_NOTIFY_TEMPLATE_UNREAD");

  public enum Result {
    kSuccess,
    kNext, kUnLogin, kUnauthorized, kBadCaptcha,
    kBadParam, kException, kNull, kNIMError, kShiroError,
    kModelError, kModelSaveError, kModelUpdateError, kModelDeleteError,
    kFileWithoutPermit, kFileCopyError, kImageThumbError, kBadLength, kBadType, kBadLocalCode,
    kBadBirthday, kBadCheck, kBadYear, kBadMonth, kBadDay, kRegistered, kBadId, Resigned, kTimeError
  }

  public enum ModelResultType {
    kNormal,
    kObject, kArray,
  }
}
